import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/Home.vue'
import Login from '../components/Login.vue'
import HelloWorld from '../components/HelloWorld.vue'
import usersList from '../components/UserManager/userList.vue'
import userPic from '../components/UserManager/userPic.vue'
import Rights from '../components/PowerManager/Right.vue'
import Roles from '../components/PowerManager/Roles.vue'
import ScheduleMain from '../components/ScheduleManager/ScheduleMain.vue'
import ScheduleDetail from '../components/ScheduleManager/ScheduleDetail.vue'
import ScheduleTemp from '../components/ScheduleManager/ScheduleTemp.vue'
import Gyms from '../components/AreaInfoManager/Gyms.vue'
import Courts from '../components/AreaInfoManager/Courts.vue'
import Areas from '../components/AreaInfoManager/Areas.vue'
import OrderList from '../components/OrderManager/OrderList.vue'

Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    title:'登录页面',
    redirect: '/Login'
  },
  {
    path: '/Login',
    name: 'Login',
    component: Login
  },
  {
    path: '/Home',
    component: Home,
    redirect:'/helloworld',
    children:[{
                path:'/helloworld',
                component:HelloWorld
              },
              {
                path:'/users',
                component:usersList
              },
              {
                path:'/rights',
                component:Rights
              },
              {
                path:'/roles',
                component:Roles
              },
              {
                path:'/ScheduleMain',
                component:ScheduleMain
              },
              {
                path:'/scheduleDetail',
                component:ScheduleDetail
              },
              {
                path:'/ScheduleTemp',
                component:ScheduleTemp
              },
              {
                path:'/gyms',
                component:Gyms
              },
              {
                path:'/areas',
                component:Areas
              },
              {
                path:'/courts',
                component:Courts
              },
              {
                path:'/orderList',
                component:OrderList
              },
              {
                path:'/userPic',
                component:userPic
              },
            ]
  },
  {
    path: '/About',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../components/About.vue')
  }
]

const router = new VueRouter({
  //mode:'hash',
  mode:'history', //去掉#
  routes
})

export default router
